# install product by installation script
ENV INTEL_OPENVINO_DIR /opt/intel/openvino

# hadolint ignore=DL3008
RUN apt-get update && \
    apt-get install -y --no-install-recommends cpio && \
    rm -rf /var/lib/apt/lists/* && \
    tar -xzf ${TEMP_DIR}/*.tgz --strip 1 && \
    sed -i 's/decline/accept/g' silent.cfg && \
    ${TEMP_DIR}/install.sh -s silent.cfg && \
    OV_BUILD="$(find /opt/intel -maxdepth 1 -type d -name "*openvino*" | grep -oP '(?<=_)\d+.\d+.\d+')" && \
    ln --symbolic /opt/intel/openvino_"$OV_BUILD"/ /opt/intel/openvino && rm -rf ${TEMP_DIR} && \
    rm -rf ${INTEL_OPENVINO_DIR}/tools/workbench
{% if no_samples is defined or 'dev_no_samples' == distribution %}
RUN rm -rf ${INTEL_OPENVINO_DIR}/extras/open_model_zoo/demos && \
    rm -rf ${INTEL_OPENVINO_DIR}/samples
{% endif %}
{% if 'runtime' == distribution %}
RUN rm -rf ${INTEL_OPENVINO_DIR}/data_processing
{% endif %}